<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@include file="includes/import.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="<%=basePathHeader%>/styles/userAvatar.css"
			type="text/css" />
<script type="text/javascript" language="javascript">
$(document).ready(function() {
	// 使用 jQuery 异步提交表单
	$('#userLogin').submit(function() {
		jQuery.ajax({
			url: '<%=basePathHeader %>/userLogin.htm',
			data: $('#userName').serialize()+'&' + $('#password').serialize(),
			type: "POST",
            complete :function(){},//AJAX请求完成时隐藏loading提示
			success: function(data){
				if(data.indexOf('success') >= 0){
					window.location = "<c:out value='${sessionScope.refererUrl}'/>";
				}else{
					var message = '';
					if(data == 'error'){
						message = '您输入的用户名或密码有误，请重新输入';
					}
					$('#error').html(message);
				}
			}
		});
		return false;
	});
});


</script>

</head>

<body>
	<div class="info">
		<dir style="float: left; width:400px;font-family: 微软雅黑;text-align: left">
		<p style="font-size: 24px;font-weight:bold;">Share With Us!</p><br/>
		<p style="font-size: 18px;">我们一直在进步！</p><br/>
			<ul>
				<li><2012-05-19> 用户管理模块基础功能开发完毕</li>
				<li><2012-05-19> 页面设计简单版本审核通过</li>
				<li><2012-05-20> 页面和设计整合完毕</li>
			</ul>
		</dir>
		<dir style="float: left; width:200px;text-align: center;">
			<form id="userLogin" action="<%=basePathHeader %>/userLogin.htm" method="post">
				用户名:<input id="userName" name="userName" type="text" value="" /><br/><br/>
				密&nbsp;&nbsp;码:<input id="password" name="password" type="password" value="" /><br/>
				<div id="error"></div>
				<br/>
				<input type="submit" value="登录"  />
				<input type="button" value="注册" onclick="window.location='<%=basePathHeader %>/initRegister.htm'" />
			</form>
		</dir>
		
	</div>
	

</body>
</html>
